package com.muyi.pojo.vo;
/*
*  通用的后台返回给前台的数据格式
* */
public class Result {
    // 响应的状态码   200---表示成功   -1-----表示异常/失败
    private Integer code = 200;
    //请求失败时，返回失败的原因
    private String msg;

    //查询时返回的数据
    private Object data;

    //总记录数，只有分页时才使用
    private long total = 0L;

    public Result(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Result() {
    }

    @Override
    public String toString() {
        return "Result{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                ", total=" + total +
                '}';
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }
}
